﻿using DBCodeBuilder.Core.Enum;
using DBCodeBuilder.Core.Interfaces;

namespace DBCodeBuilder.Core.Models
{
    public class ViewModel : IDbObjectModel
    {
        public ViewModel()
        {
            ObjectType = DbObjectType.View;
        }

        public string GeneratedClass { get; set; }
        public string GeneratedMapping { get; set; }
        public string GeneratedClassName { get; set; }
        public string Name { get; set; }
        public string Owner { get; set; }
        public DbObjectType ObjectType { get; set; }

        public TableModel TableRepresentation
        {
            get
            {
                return new TableModel
                {
                    GeneratedClass = GeneratedClass,
                    GeneratedClassName = GeneratedClassName,
                    GeneratedMapping = GeneratedMapping,
                    Name = Name,
                    Owner = Owner,
                    ObjectType = DbObjectType.View
                };
            }
        }
    }
}